<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Menu manager</title>
</head>
<body>

	<jsp:include page="../../common/bar.jsp"></jsp:include>
	<!--  nav class="navbar navbar-inverse navbar-fixed-top">
		<div class="container-fluid">
			<div class="navbar-header">
				<a class="navbar-brand" href="#" id="storeName"></a>
			</div>
			<div id="navbar" class="navbar-collapse collapse">

				<form class="navbar-form navbar-right">
					<input type="text" class="form-control" placeholder="Search menu">
				</form>

			</div>
		</div>
	</nav>-->

	<div class="container-fluid">
		<div class="row">
			<div class="col-sm-1 col-md-1 sidebar">
				<ul class="nav nav-sidebar">
					<li class="active"><a href="#">Menu Manager<span
							class="sr-only">(current)</span></a></li>
				</ul>
			</div>
			<div class="col-sm-10 col-sm-offset-1 col-md-11 col-md-offset-1 main">
				<h2 class="sub-header">Menu List</h2>
				<button type="button" class="btn btn-primary add_btn"
					data-toggle="modal" data-target="#add">Add Menu</button>


				<div class="table-responsive">
					<table class="table table-striped">
						<thead>
							<tr>
								<th>Id</th>
								<th>Name</th>
								<th>Price</th>
								<th>Img</th>
								<th>Type</th>
								<th>Modify</th>
								<th>Delete</th>
							</tr>
						</thead>
						<tbody id="menus">
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
	﻿
	<div id="modal-img" class="modal fade" tabindex="-1" role="dialog"
		style="margin-top: 5%;">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-body" style="text-align: center;">
					<div class="row">
						<div class="col-xs-12 col-md-12">
							<a href="#" class="thumbnail"> <img id="modal-img-target"
								src="">
							</a>
						</div>
					</div>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
	<!-- /.modal -->

	<div class="modal fade" id="add" tabindex="-1" role="dialog"
		aria-labelledby="addLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="addLabel">Add Menu</h4>
				</div>
				<div class="modal-body">
					<form enctype="multipart/form-data">
						<label for="name">Name</label> <input type="text"
							class="form-control" id="add_name" placeholder="pls input name">

						<br> <label for="name">Price</label> <input type="number"
							step="0.01" class="form-control" placeholder="pls input price"
							id="add_price"> <br> <label class="control-label">Image</label>
						<input id="add_img" name="add_img" type="file"
							class="file btn btn-default" data-show-preview="false"
							style="width: 100%"> <br> <label
							class="control-label">Type</br></label> <select id="add_type"
							class="selectpicker">
							<option value="2e89bb8f-6445-42ba-95cc-619166eaece5">主食</option>
							<option value="03cea5fa-5a05-4dea-81ff-5bfa5936a1e0">酒水</option>
							<option value="f3728466-9141-444c-90f5-e640a0c91244">小吃</option>
							<option value="85a39945-1683-4910-b36a-6794a045a730">套餐</option>
						</select>
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
					<button type="button" id="add_menu" class="btn btn-primary">Add
						menu</button>
				</div>
			</div>
		</div>
	</div>


	<div class="modal fade" id="update" tabindex="-1" role="dialog"
		aria-labelledby="addLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="addLabel">Update Menu</h4>
				</div>
				<div class="modal-body">
					<form enctype="multipart/form-data">

						<input type="hidden" class="form-control" id="update_id">
						<input type="hidden" class="form-control" id="update_imgpath">

						<label for="name">Name</label> <input type="text"
							class="form-control" id="update_name"
							placeholder="pls input name"> <br> <label for="name">Price</label>
						<input type="number" step="0.01" class="form-control"
							placeholder="pls input price" id="update_price"> <br>
						<label class="control-label">Image</label> <input id="update_img"
							name="update_img" type="file" class="file btn btn-default"
							data-show-preview="false" style="width: 100%"> <br>
						<label class="control-label">Type</br></label> <select id="update_type"
							class="selectpicker">
							<option value="2e89bb8f-6445-42ba-95cc-619166eaece5">主食</option>
							<option value="03cea5fa-5a05-4dea-81ff-5bfa5936a1e0">酒水</option>
							<option value="f3728466-9141-444c-90f5-e640a0c91244">小吃</option>
							<option value="85a39945-1683-4910-b36a-6794a045a730">套餐</option>
						</select>


					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
					<button type="button" id="update_menu" class="btn btn-primary">Update
						menu</button>
				</div>
			</div>
		</div>
	</div>
	<input type="hidden" class="mid" id="mid" value="${m.id}">
	<script type="text/javascript">
		$(function() {
			var mid = $.notify.getUrlParam("mid");
			if (mid == undefined || mid == null) {
				mid = $("#mid").val();
			}
			console.log(mid);
			$.notify.work($("#modal2"), mid, 3 * 1000);
		});
	</script>
</body>


</html>